package com.ocom.ugcapi.client;

import com.ocom.common.constant.PayHandleUrl;
import com.ocom.common.request.payhandle.*;
import com.ocom.common.entity.card.EntityXfRecordProcess;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.pay.CallBackVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;


@FeignClient(value = "payhandle")
public interface PayHandleClientService {

	@PostMapping(PayHandleUrl.URL_PreOrder)
	public Result preOrder(@RequestBody EntityXfRecordProcess entityXfRecord);

	@PostMapping(PayHandleUrl.URL_updateEntityXfRecord)
	public Result updateEntityXfRecord(@RequestBody EntityXfRecordProcess entityXfRecord);

	@PostMapping(PayHandleUrl.URL_callback)
	public Result callback(@RequestBody CallBackVo callBackVo);


	@PostMapping(PayHandleUrl.URL_getOrderInfo)
	public Result getOrderInfo(@RequestParam("companyId") Long companyId, @RequestParam("tradeNo")String tradeNo,@RequestParam("machNo") String machNo);


	@PostMapping(PayHandleUrl.URLP_PayConfig_GetMerchInfoByMachNo)
	public Result GetMerchInfoByMachNo(@RequestParam("comId") Long comId,@RequestParam("machNo") String machNo);

	//主扫支付
	@PostMapping(PayHandleUrl.URL_PayHandle_staticCodePay)
	public Result staticCodePay(@RequestBody StaticCodePayRequest request);

	@PostMapping(PayHandleUrl.URL_PayHandle_getUsefuleMerchPayInfo)
	public Result getUsefuleMerchPayInfo(@RequestParam("companyId")Long companyId,@RequestParam("machNo")String machNo,
										 @RequestParam("type")Integer type);


	//点餐主扫支付
	@PostMapping(PayHandleUrl.URL_PayHandle_orderDishesPay)
	public Result orderDishesPay(@RequestBody OrderDishesPayRequest request) ;

	@PostMapping(PayHandleUrl.URL_PayHandle_orderDishesPay3)
	public Result orderDishesPay3(@RequestBody OrderAddPackagePayRequest request) ;

	@PostMapping(PayHandleUrl.URL_syncSaveGoodList)
	public Result syncSaveGoodList(@RequestParam("comId")Long comId,@RequestParam("orderNo") String orderNo);

	@PostMapping(PayHandleUrl.URL_PayHandle_backPay)
	public Result backPay(@RequestBody BackPayRequest request);


	@PostMapping(PayHandleUrl.URL_PayHandle_paraRefund)
	public Result paraRefund(@Valid @RequestBody FeeRefundRequest request);

	@PostMapping(PayHandleUrl.URL_PayHandle_getRecordProcess)
	public Result getRecordProcess(@RequestBody GetRecordProcessRequest request);

	@PostMapping(PayHandleUrl.URL_checkWithhold)
	public Result checkWithhold(@RequestBody CheckPayRequest request);


	@PostMapping(PayHandleUrl.URL_PayHandle_qrCodeRefund)
	public Result qrCodeRefund(@Valid @RequestBody QrCodeRefundRequest request);


	@PostMapping(PayHandleUrl.URL_gzhRechageRefund)
	public Result gzhRechageRefund(@RequestBody GzhRechageRefundRequest request) ;

	@PostMapping(PayHandleUrl.getPayCard)
	public Result getPayCard(@RequestBody  QrCardPayRequest request);

	@PostMapping(PayHandleUrl.URL_shoppingCartPay)
	public Result shoppingCartPay(@RequestBody ShoppingCartRequest request);
}
